#ifndef _HAL_AIP33629_H
#define _HAL_AIP33629_H
#include "main.h"
#include "bsp.h"


extern void _nop_ (void);

/* 宏定义 -------------------------------------------------------------------*/
#define AiP33629_SCL_L           HAL_GPIO_WritePin(AIP33629_SCL_GPIO_Port,	AIP33629_SCL_Pin, 			GPIO_PIN_RESET)   
#define AiP33629_SCL_H           HAL_GPIO_WritePin(AIP33629_SCL_GPIO_Port,	AIP33629_SCL_Pin, 			GPIO_PIN_SET)  
#define AiP33629_SDA_L           HAL_GPIO_WritePin(AIP33629_SDA_GPIO_Port,	AIP33629_SDA_Pin, 			GPIO_PIN_RESET)  
#define AiP33629_SDA_H           HAL_GPIO_WritePin(AIP33629_SDA_GPIO_Port,	AIP33629_SDA_Pin, 			GPIO_PIN_SET)   
#define AiP33629_SCL_OUT()     	 gpio_init(AIP33629_SCL_GPIO_Port, 					GPIO_MODE_OUT_PP, 			GPIO_OSPEED_50MHZ,	AIP33629_SCL_Pin);
#define AiP33629_SDA_IN()      	 gpio_init(AIP33629_SDA_GPIO_Port, 					GPIO_MODE_IN_FLOATING, 		GPIO_OSPEED_50MHZ,	AIP33629_SDA_Pin);
#define AiP33629_SDA_OUT()     	 gpio_init(AIP33629_SDA_GPIO_Port, 					GPIO_MODE_OUT_PP, 			GPIO_OSPEED_50MHZ,	AIP33629_SDA_Pin);
#define AiP33629_READ_SDA 			 HAL_GPIO_ReadPin(AIP33629_SDA_GPIO_Port, AIP33629_SDA_Pin)   

#define Address_Write_00 0x78


/* 函数申明 -----------------------------------------------------------------*/
void IIC_HOLD(void);
void AiP33629_start(void);
void AiP33629_stop(void);
void AiP33629_ACK(void);
void AiP33629_write(unsigned char dat);
void AiP33629_init(void);
void AiP33629_Write_CMD(unsigned char cmd);
void AiP33629_I2C_Write_144(unsigned char dat);
void AiP33629_I2C_Write_Single(unsigned char GRIDn,unsigned char SEGn,unsigned char PWMn,unsigned char Lengethn);
void AiP33629_RGB_Display(unsigned int RGB_dat);

void OnTestLed(void);
#endif

